<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Edit Scheduling</title>
<link rel="stylesheet" type="text/css" href="component/jquery-easyui-1.5.1/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="component/jquery-easyui-1.5.1/themes/icon.css">
<link rel="stylesheet" type="text/css" href="../demo.css">
<script type="text/javascript" src="component/jquery-easyui-1.5.1/jquery.min.js"></script>
<script type="text/javascript" src="component/jquery-easyui-1.5.1/jquery.easyui.min.js"></script>
</head>

<script type="text/javascript">
function saves(){
	$.ajax({
	    type: "get",
	    url:"editScheduling.action",
	    data:$('#editScheduling').serialize()
	    +"&startDate="+$('#startDate').datebox('getValue')
	    +"&endDate="+$('#endDate').datebox('getValue')
	    +"&mycvResume="+$('#mycvResume').datebox('getValue')
	    +"&user_id="+$('#user_id').datebox('getValue'),
	    async: false,
	    error: function(request) {
	      alert("error,fail to update!");
	    },
	    success: function(data) {
	    	alert("success");
	    	window.location.href = 'searchPage.action?number='+${number};
	    }
	});
}
</script>

<body>
<table border="1">
	<tr>		
		<td colspan="1">schedule_name</td>
		<td colspan="1">client</td>
		<td colspan="1">project</td>
		<td colspan="1">role</td>
		<td colspan="1">startDate</td>
		<td colspan="1">endDate</td>
		<td colspan="1">mycvResume</td>
		<td colspan="1">user_id</td>
	</tr>
	<form id="editScheduling" action="editScheduling.action" method="get" >
		<tr>
			<input id="schedule_id" name="schedule_id" type="hidden" value="${scheduling.schedule_id}"/>
			<td colspan="1"><input id="schedule_name" name="schedule_name" value="${scheduling.schedule_name}" type="text"></td>
			<td colspan="1"><input id="client" name="client" value="${scheduling.client}" type="text"/></td>
			<td colspan="1"><input id="project" name="project" value="${scheduling.project}" type="text"/></td>
			<td colspan="1"><input id="role" name="role" value="${scheduling.role}" type="text"/></td>
			<td colspan="1"><input class="easyui-datebox"  id="startDate" name="startDate" value="${scheduling.startDate}" required="required" type="text"/></td>
			<td colspan="1"><input class="easyui-datebox"  id="endDate" name="endDate" value="${scheduling.endDate}" required="required" type="text"/></td>
			<td colspan="1"><input class="easyui-datebox"  id="mycvResume" name="mycvResume" value="${scheduling.mycvResume}" required="required" type="text"/></td>
			<td colspan="1"><select class="easyui-combobox" id="user_id" name="user_id" style="width:50%;" type="text" readonly>
								<c:forEach items="${userList}" var="list">
									<option <c:if test="${scheduling.user_id==list.user_id}">selected="selected"</c:if>value="${list.user_id}">${list.user_id}</option>
								</c:forEach>
							</select>
						</td>				
		</tr>
		<input onclick="saves()" type="button" value="Save"/>
	</form>	
</table>

</body>
</html>